package com.example.demo.dao;

import com.example.demo.demos.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

public interface UserDao extends JpaRepository<User,Integer> {

    List<User> findByUsernameAndPassword(String user, String pwd);

    List<User> findByUsername(String user);
    List<User> findByEmail(String email);
    @Query(value = "select * from user where nickname like concat('%', ?3 , '%') lIMIT ?1,?2",nativeQuery = true)
    List<Map<String,Object>> getList(int page,int pageSize,String nickname);
}
